Add fine_coordinates to model with validation against StaticInputs#999
Merged
Add fine_coordinates to model with validation against StaticInputs#999
Conversation
ff04394 to
665dfb9
Compare
1 task
Here's a summary of the fixes made in this session: test_models.py: - test_checkpoint_model_build_raises_when_checkpoint_has_static_inputs: added full_fine_coords=static_inputs.coords to _get_diffusion_model call - Added test_checkpoint_model_build_with_fine_coordinates_path: tests loading an old-format checkpoint (no full_fine_coords in state) using fine_coordinates_path - Removed unused batch_size variable in test_model_error_cases data/config.py: - Captured fine_latlon_coords = dataset_fine_subset.subset_latlon_coordinates before the variable gets reassigned to BatchItemDatasetAdapter predict.py: - Fixed EventDownscaler.run() to pass batch (the full BatchData) instead of batch[0] (a BatchItem) to get_fine_coords_for_batch test_predict.py: - Both test_predictor_runs and test_predictor_renaming: load static_inputs first, then pass full_fine_coords=static_inputs.coords to model_config.build() inference/test_inference.py: - checkpointed_model_config fixture: added full_fine_coords=static_inputs.coords to model_config.build()# Please enter the commit message for your changes. Lines starting
c19923d to
7af66f7
Compare
frodre
commented
Mar 24, 2026
| return ds | ||
|
|
||
|
|
||
| def load_coords_from_path(path: str) -> LatLonCoordinates: |
Collaborator
Author
There was a problem hiding this comment.
Re-added to use in CheckpointModelConfig. Added the small helper _open_ds_from_path to de-dupe code
AnnaKwa
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 3/3 for #971 split
Changes
Add
full_fine_coords: LatLonCoordinatestoDiffusionModelas the canonical source of truth for the fine-resolution grid, decoupled fromStaticInputsValidate at build time that
static_inputs.coordsmatchesfull_fine_coordswhen both are providedRemove dead runtime guard in
_get_input_from_coarsefor missing static inputs whenuse_fine_topography=True; this is now enforced at build timeAdd
fine_coordinates_pathtoCheckpointModelConfigfor backwards-compatible loading of old checkpoints that lack stored fine coordinatesAdd
StaticInputs.from_state_backwards_compatiblefor checkpoint loading that handles both old and new state formatsRemove
_downscale_coordbandaid frompredict.py;get_fine_coords_for_batchnow usesfull_fine_coordsdirectlyAdd
fine_coordsfield toPairedGriddedDataand thread it through toTrainerConfig.buildTests added